'use strict';

var browserSync = require('browser-sync');
var browserSyncCreate = browserSync.create();
var reload = browserSyncCreate.reload;

function browserSyncInit(baseDir, browser) {
  browser = browser ? 'default' : browser;
  var server = {
    baseDir: baseDir
  };
  browserSync.instance = browserSyncCreate.init({
    // proxy: "localhost:9999", //apache或iis等代理地址
    // port: 8080,
    notify: false, //刷新是否提示
    // open: false, //是否自动打开页面
    startPath: '/404.html',
    server: server,
    browser: browser
  });
}

exports.reload = reload;
exports.browserSyncInit = browserSyncInit;
